from tkinter import *
from tkinter.messagebox import *


class InputFrame(object):  # 继承Frame类
    def __init__(self, master=None,page=None):
        # Frame.__init__(self, master)
        self.root = master  # 定义内部变量root
        self.page = page
        self.itemName = StringVar()
        self.importPrice = StringVar()
        self.sellPrice = StringVar()
        self.deductPrice = StringVar()
        self.createPage()

    def createPage(self):

        Label(self.page, text='数据录入界面').grid(padx=20, pady=10)
        Label(self.page).grid(row=0, stick=W, pady=10)
        Label(self.page, text='药品名称: ').grid(row=1, stick=W, pady=10)
        Entry(self.page, textvariable=self.itemName).grid(row=1, column=1, stick=E)
        Label(self.page, text='进价 /元: ').grid(row=2, stick=W, pady=10)
        Entry(self.page, textvariable=self.importPrice).grid(row=2, column=1, stick=E)
        Label(self.page, text='售价 /元: ').grid(row=3, stick=W, pady=10)
        Entry(self.page, textvariable=self.sellPrice).grid(row=3, column=1, stick=E)
        Label(self.page, text='优惠 /元: ').grid(row=4, stick=W, pady=10)
        Entry(self.page, textvariable=self.deductPrice).grid(row=4, column=1, stick=E)
        Button(self.page, text='录入').grid(row=6, column=1, stick=E, pady=10)


class QueryFrame(object):  # 继承Frame类
    def __init__(self, master=None,page=None):
        self.root = master  # 定义内部变量root
        self.page = page
        self.itemName = StringVar()
        self.createPage()

    def createPage(self):

        Label(self.page, text='查询页面').grid(padx=20,pady=10)
        Label(self.page).grid(row=0, stick=W, pady=10)
        Label(self.page, text='请输入查询数据: ').grid(row=1, stick=W, pady=10)
        Entry(self.page, textvariable=self.itemName).grid(row=1, column=1, stick=E)





class CountFrame(object):  # 继承Frame类
    def __init__(self, master=None,page=None):
        self.root = master  # 定义内部变量root
        self.page = page
        self.createPage()

    def createPage(self):

        Label(self.page, text='统计界面').grid(padx=20, pady=10)
        Label(self.page).grid(row=0, stick=W, pady=10)
        Label(self.page, text='统计结果: ').grid(row=1, stick=W, pady=10)





class AboutFrame(object):  # 继承Frame类
    def __init__(self, master=None,page=None):
        self.root = master  # 定义内部变量root
        self.page = page
        self.createPage()

    def createPage(self):
        Label(self.page, text='关于界面').grid(padx=20, pady=10)
        Label(self.page).grid(row=0, stick=W, pady=10)
        Label(self.page, text='关于: ').grid(row=1, stick=W, pady=10)

